load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("@io_bazel_stardoc//stardoc:stardoc.bzl", "stardoc")

bzl_library(
    name = "bazel_tools_bzl_srcs",
    srcs = ["@bazel_tools//tools:bzl_srcs"],
)

# NOTE: when the `out` is changed, the `nav` part of `mkdocs.yaml` must be also be changed correspondingly.
stardoc(
    name = "user_docs",
    out = "user/user_docs.md",
    input = "user_docs.bzl",
    deps = [
        ":bazel_tools_bzl_srcs",
        "@rules_cuda//:bzl_srcs",
    ],
)

stardoc(
    name = "toolchain_config_docs",
    out = "user/toolchain_config_docs.md",
    input = "toolchain_config_docs.bzl",
    deps = [
        ":bazel_tools_bzl_srcs",
        "@rules_cuda//:bzl_srcs",
    ],
)

stardoc(
    name = "providers_docs",
    out = "developer/providers_docs.md",
    input = "providers_docs.bzl",
    deps = [
        ":bazel_tools_bzl_srcs",
        "@rules_cuda//:bzl_srcs",
    ],
)

stardoc(
    name = "developer_docs",
    out = "developer/developer_docs.md",
    input = "developer_docs.bzl",
    deps = [
        ":bazel_tools_bzl_srcs",
        "@rules_cuda//:bzl_srcs",
    ],
)

filegroup(
    name = "all_docs",
    srcs = [
        ":developer_docs",
        ":providers_docs",
        ":toolchain_config_docs",
        ":user_docs",
    ],
)
